package com.ukao.cashregister.widget;

import android.app.Activity;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.PopupWindow;

import com.ukao.cashregister.R;
import com.ukao.cashregister.adapter.AddClothingAdapter;
import com.ukao.cashregister.bean.AddClothingItem;
import com.ukao.cashregister.listener.OnClickPopWindowListener;

import java.util.ArrayList;

public class SearchStockinPopWindow extends PopupWindow {

	private Context mContext;
	private RecyclerView mListView;
	private AddClothingAdapter mAdapter;
	private OnClickPopWindowListener mItemSelectListener;


	public SearchStockinPopWindow(Context context)
	{
		super(context);

		mContext = context;
		init();
	}




	public void setItemListener(OnClickPopWindowListener listener){
		mItemSelectListener = listener;
	}

	public void setAdatper( AddClothingAdapter adapter){
		mAdapter = adapter;
		mListView.setAdapter(mAdapter);

	}
	public void setData( ArrayList<AddClothingItem>   mData){
		mAdapter.setDatas(mData);


	}

	private void init()
	{
		View view = LayoutInflater.from(mContext).inflate(R.layout.pop_window_search_stockin, null);
		setContentView(view);
		setWidth(LayoutParams.WRAP_CONTENT);
		setHeight(LayoutParams.WRAP_CONTENT);
		setTouchable(true);
		setFocusable(true);
		Activity mActivity = (Activity) mContext;

		setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.transparent));
		mListView = (RecyclerView) view.findViewById(R.id.search_recyclerView);
		mListView.setLayoutManager(new LinearLayoutManager(mContext));






	}










	
}
